package com.sherpas.android.component.activity.base;

import com.sherpas.android.R;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public abstract class BaseActivity extends ActionBarActivity implements
		BaseActivityImpl {
	protected TextView navTitle;
	protected ImageView navBtnLeft, navBtnRight;
	protected View layoutTitleBar;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView();
		initComponents();
		addListeners();
	}

	@Override
	public void initComponents() {
		navTitle = (TextView) findViewById(R.id.nav_tv_title);
		navBtnLeft = (ImageView) findViewById(R.id.nav_btn_left);
		navBtnRight = (ImageView) findViewById(R.id.nav_btn_right);
		layoutTitleBar = findViewById(R.id.layout_title_bar);
		if (navTitle != null) {
			navTitle.setSelected(true);
		}

	}

	public void setNavTitle(CharSequence title) {
		navTitle.setText(title);
	}

	public void setNavTitle(int resId) {
		navTitle.setText(resId);
	}

}
